<div class="row">
  <div class="panel panel-default">
    <div id="stepDefinitionTab" class="panel-heading panel-title" data-toggle="collapse" data-target="#step_definitions">
      Step Definitions <span class="glyphicon glyphicon-menu-down"></span>
    </div>

    <div id="step_definitions" class="panel-body collapse">
      <span class="button-bar">
        <%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
        <div class="btn-group" data-toggle="buttons">
          <div id="showDeadSteps" class="btn btn-default">
            <input type="checkbox"/>Show Dead Steps
          </div>
        </div>
      </span>
      <% if cuke_sniffer.step_definitions.count == 0 %>
          <div>
            <div>There were no Step Definitions to sniff in '<%= cuke_sniffer.step_definitions_location %>'!</div>
          </div>
      <% elsif cuke_sniffer.step_definitions.count >= 1 && cuke_sniffer.summary[:step_definitions][:total_score] ==0 %>
          <div>
            <div>Excellent! No smells found for Step Definitions!</div>
          </div>
      <% else %>
          <% cuke_sniffer.step_definitions.each do |step_definition| %>
              <% next if step_definition.score == 0 %>
              <div class="stepDefinition <%if step_definition.calls.size == 0%>deadStep<% end %>">
                <div class="row">
                  <div class="col-md-12 title">
                    <div class="col-md-1 red" title="Total Score from this Step Definition file.">
                      <%= step_definition.score %>
                    </div>
                    <div class="col-md-11">
                          /<%= step_definition.regex.to_s.gsub(/[(]\?-mix:/, "")[0...-1] %>/
                    </div>
                  </div>
                  <div class="details col-md-12" style="display: none;">
                    <div class="well">
                      <div class="row">
                        <div class="col-md-12 filename">
                          File: <a target="_blank" href="file:///<%= step_definition.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
                              <%= step_definition.location.gsub(cuke_sniffer.step_definitions_location, '') %>
                            </a>
                        </div>
                        <div class="col-md-12">
                          <% if cuke_sniffer.cataloged? %>
                              Call(s): <%= step_definition.calls.size %>
                          <% else %>
                              Not cataloged
                          <% end %>
                        </div>
                      </div>
                      <div class="row well">
                        <% SummaryHelper::sort_improvement_list(step_definition.rules_hash).each do |phrase, count| %>
                            <div class="row" data-improvement-row>
                                <div class="col-md-1 red" data-score>
                                  <%= count %>
                                </div>
                                <div class="col-md-11" data-improvement="<%=phrase %>">
                                  <%= phrase %>
                                </div>
                            </div>
                        <% end %>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
          <% end %>
      <% end %>

    </div>
  </div>
</div>